<script type="text/javascript" src="http://tinymce.moxiecode.com/js/tinymce/jscripts/tiny_mce/jquery.tinymce.js"></script>
<script type="text/javascript" src="http://tinymce.moxiecode.com/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'announcement-form',
	'enableAjaxValidation'=>false,
//        'enableClientValidation' => true,
//        'clientOptions' => array(
//            'validateOnSubmit' => true,
//        ),
//        'htmlOptions' => array('enctype' => 'multipart/form-data')
)); ?>

	<table class="button-form"><tr>
		<td><span class="note">Thông tin bắt buộc <span class="required">*</span>.</span></td>
		<td align="right">
			<div class="row buttons"><?php echo CHtml::submitButton($model->isNewRecord ? 'Đăng kí' : 'Cập nhật'); ?></div>
		</td>
	</tr></table>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
			<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php
			$this->widget('application.extensions.tinymce.ETinyMce', array(
							'id' 		=> 'Announcement_description',
							'model' 	=> $model,
							'name' 		=> 'Announcement[description]',
							'options' 	=> array(
								 'theme' => "advanced",
										 'width' => '51%',
										 'height' => 100,
										 'theme_advanced_toolbar_location' 	=> "top",
										 'theme_advanced_toolbar_align' 	=> 'left',
										 'theme_advanced_buttons1' 			=> "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,|,undo,redo,|,cleanup",
										 'theme_advanced_buttons2' 			=> "",
										 'theme_advanced_buttons3' 			=> ""
							),
							'value' 	=> $model->description,
			));
		?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'content'); ?>
		<?php
			$this->widget('application.extensions.tinymce.ETinyMce', array(
							'id' 		=> 'Announcement_content',
							'name' 		=> 'Announcement[content]',
							'model' 	=> $model,
								'plugins' => array('jbimages','advimage'),
								'options' 	=> array(
							'theme' 							=> 'advanced',
							'theme_advanced_toolbar_location' 	=> 'top',
							'theme_advanced_buttons1' 			=> 'newdocument,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,fontselect,fontsizeselect,formatselect',
							'theme_advanced_buttons2' 			=> 'jbimages, | cut,copy,paste,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,|,code,preview,|,forecolor,backcolor',
							'theme_advanced_buttons3' 			=> '',
							'theme_advanced_toolbar_align' 		=> 'left'
							),
							'value' => $model->content
			));
		?>
		<?php echo $form->error($model,'content'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'event_fg'); ?>
			<?php echo $form->dropDownList($model,'event_fg',Util::itemAlias('Event')); ?>
		<?php echo $form->error($model,'event_fg'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'event_end_date'); ?>
			<?php echo $form->textField($model,'event_end_date',array('class'=> 'picker-date')); ?>
		<?php echo $form->error($model,'event_end_date'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'position'); ?>
			<?php echo $form->textField($model,'position'); ?>
		<?php echo $form->error($model,'position'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'status'); ?>
			<?php echo $form->dropDownList($model,'status',Util::itemAlias('Status')); ?>
		<?php echo $form->error($model,'status'); ?>
	</div>

	<?php if (!$model->isNewRecord): ?>
		<input type="hidden" name="update_id" value="<?php echo $model->id; ?>"/>
	<?php endif; ?>

	<table class="button-form"><tr>
		<td align="right">
			<div class="row buttons"><?php echo CHtml::submitButton($model->isNewRecord ? 'Đăng kí' : 'Cập nhật'); ?></div>
		</td>
	</tr></table>

<?php $this->endWidget(); ?>

</div><!-- form -->